function setZeroes(matrix: number[][]): void {
  let arr: number[][] = [];
  for (let i = 0; i < matrix.length; i++) {
    for (let j = 0; j < matrix[i].length; j++) {
      if (matrix[i][j] == 0) {
        arr.push([i, j]);
      }
    }
  }
  arr.forEach((item) => {
    matrix[item[0]].fill(0);
    for (let i = 0; i < matrix.length; i++) {
      matrix[i][item[1]] = 0;
    }
  });
  for (let i = 0; i < matrix.length; i++) {
    for (let j = 0; j < matrix[i].length; j++) {
      console.log(matrix[i][j]);
    }
  }
}
setZeroes([
  [1, 1, 1],
  [1, 0, 1],
  [1, 1, 1],
]);
